package unit.entity;

import static org.junit.Assert.*;

import java.util.Date;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import am.bll.entity.AccountItem;
import am.bll.entity.basic.Money;
import am.bll.entity.basic.Quantifier;

public class AccountItemTester
{

    @Before
    public void setUp() throws Exception
    {
    }

    @After
    public void tearDown() throws Exception
    {
    }

    @Test
    public void testConstructor()
    {
        // case 01: 一般
        AccountItem a01 = new AccountItem();
        a01.setAmount(new Quantifier(34, "千"));
        a01.setId(93);
        a01.setName("卧槽");
        //a01.setPayment(payment);
        a01.setPicUrl("http://www.baidu.com");
        a01.setRemark("这个真不是账目");
        a01.setTarget("沃尔玛");
        a01.setTime(new Date(1900, 11, 22));
        a01.setTotal(new Money("222.2"));

        assertEquals("34千", a01.getAmount().toString());
        assertEquals(93, a01.getId());
        assertEquals("卧槽", a01.getName());
        assertEquals("http://www.baidu.com", a01.getPicUrl());
        assertEquals("这个真不是账目", a01.getRemark());
        assertEquals("沃尔玛", a01.getTarget());
        assertEquals(new Date(1900, 11, 22), a01.getTime());
        assertTrue(new Money("222.2").compare(a01.getTotal()) == 0);

    }
}
